from flask_restful import Api,Resource,reqparse
from flask import jsonify,json,Blueprint

qiniu_bp = Blueprint('qiniu_bp',__name__)

api = Api(qiniu_bp)


from qiniu import Auth
class QiniuToken(Resource):

    def get(self):
        ak = 'zTsj6_PmluJ2MPYLMfcbHFaQBJpyz5Y6QKXbXB18'
        sk = 'h0hmO0CHeiV7fAqllpsEgS-Ru0VsUwyoaj2fINue'
        bucket = 'gujianyong'
        q = Auth(ak,sk)
        token = q.upload_token(bucket)
        return token
api.add_resource(QiniuToken,'/uptoken/')
